﻿using IdentityModel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using net8.Helper;
using System.Text.Json.Serialization;

namespace net8.Controllers
{
    /// <summary>
    /// 表达式操作
    /// </summary>
    [Route("api/[controller]/[action]")]
    [AllowAnonymous]
    [ApiController]
    public class ExpressionController : ControllerBase
    {
        [HttpGet]
        public async void Get()
        {
            
        }

        /// <summary>
        /// 返回实体
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [NonUnify]
        public TestEntity GetEntity()
        {
            return new TestEntity() { State = 1, Info = "测试" };
        }
    }

    public class TestEntity
    {
        public int State { get; set; }
        public string Info { get; set; }
    }

    public class TestResult : ThirdResultInterface
    {
        [JsonPropertyName("state")]
        public string Code { get; set; }

        [JsonPropertyName("info")]
        public string Msg { get; set; }
    }
}
